<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;


/**
 * 企业签到用户
 */
class QiyeController extends HomeController {

	public function index(){

		$options = array(
	     'token'=>'j2SH7Q1416453775',    //填写应用接口的Token
	     'encodingaeskey'=>'EWVd9keVglQ8Pm32uxj2oLlOFlapW3ib99j9wQ9rCiC',//填写加密用的EncodingAESKey
	     'appid'=>'wx015b0a276638b14d',    //填写高级调用功能的appid
	     'debug'=>true,
	     );

		vendor('WXBiz.Wechat');
		$weObj = new \Wechat($options);

		$ret=$weObj->valid();
		if (!$ret) {var_dump($ret);}
    	//获取发送消息的用户昵称
		$f = $weObj->getRev()->getRevFrom();
    	//获取发送来的消息类型
		$t = $weObj->getRevType();
    	//获取发送来的原始信息
		$content = $weObj->getRevContent();

		$k=$weObj->getRevEvent();// 获取里面的key就是桌面的“num”
		$weObj->text("这是文字消息:".$k['key'].$content )->reply();
		die;


	}



}
